*This file reads parameters used in the program

*Global of the distribution used to define the consumption and income uncertainty
global dist sptri /*sptri trio*/

*Globals of outcomes (all at the family-level)
global outl w005_hpconch_nyr

*Number of outcomes
global outno: word count ${outl}

*Global of treatments
global gtlist q3_hm${dist}_sqcgr
global tno: word count ${gtlist}

*Global of MIV instruments
*First MIV instrument
global minstr1 q10_hv${dist}_incgr
*Number of values for the first monotone instrument
*ATTENTION: for the 10-valued categorical hvtrio_incgr we reduce the number of values by 1
*due to insufficient number of observations in the second quantile
global mvi1n = 9

*Number of MIV instruments used
if "${minstr1}"=="" {
   global mmxi=0 
}
else if "${minstr1}"!="" & "${minstr2}"=="" {
   global mmxi=1
}

*Given the choices of intruments (MIV), the globals of estimation methods are defined
*Globals of methods
*nex = exogenous treatment selection
global g_nex=1
*n = no selection, no MTR, no MTS
global g_n=1
*nr = no selection, MTR, no MTS
global g_nr=1
*nrmv1 = no selection, MTR, no MTS, MIV 1 instr
global g_nrmv1=1
*nrmv2 = no selection, MTR, no MTS, MIV 2 instr


*Global of methods not needing bias correction
global gnobias0 
foreach m in nex n nr {
  if ${g_`m'}==1 {
     global gnobias0 ${gnobias0} `m'  
  }
}
global gnobias0_n: word count ${gnobias0}

*Global of methods needing bias correction, and for which this correction is applied
global gbias0 ""
if "${minstr1}"~="" {
  foreach m in nrmv1 {
     if ${g_`m'}==1 {
       global gbias0 ${gbias0} `m'  
     }
  }
}
global gbias0_n: word count ${gbias0}

*Global of all methods
global gmethod ${gnobias0} ${gbias0}
global gmethod_n: word count ${gmethod}
assert ${gmethod_n}>0

*Global of methods needing bias correction, for which this correction is not applied
global gbiasnb ""
foreach g in $gbias0 {
   global gbiasnb ${gbiasnb} `g'nb
}

*Global of all methods, including those needing bias correction but without the correction applied
global gmethod2 ${gmethod} ${gbiasnb}
global gmethod2_n: word count ${gmethod2}


*Global of methods for which the lower bound can be less than zero
*In this application it consists of methods n and nex
global m0 n nex
global nm0: word count ${m0}
*Checking that this global is greater than zero
assert ${nm0}>0

*Global of methods requiring bias correction for which the lower bound can be less than zero
*In this application it is empty
global m0nb ""
global nm0nb: word count ${m0nb}

*Global of sample weight
global wgt wgth

*Number of boostrap replications
global bsn = 1000

*Grid points over which the coefficient for the calculation of Imbens=Manski
*confidence intervals is determined
global incc = 500

*Coverage of the confidence interval
global cicv .95 .9 
global ncicv: word count ${cicv}

*Tolerance
global tolr = 1e-10
sca tolr = ${tolr}

*Dummy value
global dumval=-999999

*Global of cluster variable in the bootstrap
global clustv nohhold 

